package com.financing.platform.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IXcxNewsDao;
import com.financing.platform.dto.XcxNewsDTO;
import com.financing.platform.util.SqlName;
/**
 * xcx_news  
 * 小程序消息通知 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("xcxNewsDao")
public class XcxNewsDaoImpl extends BaseDaoImpl implements IXcxNewsDao {

	@Override
	public int insert(XcxNewsDTO xcxNews) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.XcxNewsSql.insert, xcxNews);
	}

	@Override
	public void update(XcxNewsDTO xcxNews) throws SQLException {
		this.sqlMapClient.update(SqlName.XcxNewsSql.update, xcxNews);
	}

	@Override
	public void updateForce(XcxNewsDTO xcxNews) throws SQLException {
		this.sqlMapClient.update(SqlName.XcxNewsSql.updateForce, xcxNews);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.XcxNewsSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<XcxNewsDTO> queryList(XcxNewsDTO xcxNews) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.XcxNewsSql.queryList, xcxNews);
	}

	@Override
	public int queryListCount(XcxNewsDTO xcxNews) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.XcxNewsSql.queryListCount, xcxNews);
	}

	@Override
	public XcxNewsDTO loadById(Integer id) throws SQLException {
//		return  (XcxNewsDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.XcxNewsSql.loadById,id);
		
		return null;
	}

//	@Override
//	public Class<XcxNewsDTO> getEntityClass() {
//		return XcxNewsDTO.class;
//	}
// 	
}
